/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package _4_Mapper;

import _3_Object.UserProfileObject;
import _5_DB.ConnectDB;
import java.sql.CallableStatement;
import java.sql.Connection;

/**
 *
 * @author DOM
 */
public class UpdateProfileMapper {
    public static int upo(UserProfileObject u)
    {
        int retvl=-1;
        try{
            ConnectDB db = new ConnectDB();
            Connection con = db.getConnection();
            CallableStatement proc = null;
            proc = con.prepareCall("{call procSuaUser(?,?,?,?,?,?,?,?,?,?)}");
            
            proc.setInt(1, u.getuID());
            proc.setString(2, u.getName());
            proc.setString(3, u.getBirth());
            proc.setInt(4, u.getSex());
            proc.setString(5, u.getEmail());
            proc.setString(6, u.getPhone());
            proc.setString(7, u.getAbout());
            proc.setString(8, u.getAvatar());
            proc.setString(9, u.getSetting());
            proc.setString(10, u.getUrl());
            
            retvl = proc.executeUpdate();
           
        }
        catch(Exception ex)
        {
            
        }
        
        return retvl;
    }
}
